import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_jd/pages/tabbar/home/controller.dart';
import 'package:flutter_jd/ui/pages/application/goods_list.dart';
import 'package:flutter_jd/ui/pages/home/mall_list.dart';
import 'package:flutter_jd/ui/pages/home/top_bar.dart';
import 'package:flutter_jd/ui/pages/home/seckill.dart';
import 'package:flutter_jd/ui/pages/home/slide_nav.dart';
import 'package:flutter_jd/ui/pages/home/background.dart';
import 'package:flutter_jd/ui/widgets/swiper/swiper.dart';
import 'package:get/get_state_manager/get_state_manager.dart';
import 'package:get/route_manager.dart';
import 'package:get/get.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

// 首页
class Home extends GetView<HomeController> {
  @override
  Widget build(BuildContext context) {
    Get.put(HomeController());

    return AnnotatedRegion<SystemUiOverlayStyle>(
      value: SystemUiOverlayStyle.light,
      child: Scaffold(
        body: Stack(
          children: [
            Background(),
            HomeTopBar(),
            Container(
              margin: EdgeInsets.only(top: controller.mainTop),
              height: controller.mainHeight.h,
              child: NotificationListener(
                onNotification: (e) {
                  controller.onScroll(e);
                  return true;
                },
                child: SingleChildScrollView(
                  child: Column(
                    children: [
                      SlideNav(),
                      SwiperKit(list: controller.bannerList),
                      MallList(),
                      Seckill(),
                      GoodsList(
                        goodsList: controller.goodsList,
                      )
                    ],
                  ),
                ),
              ),
            ),
          ],
        ),
      ),
    );
  }
}
